<#assign module="order"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/datepicker/datepicker.css">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
<link href="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.css" rel="stylesheet"
      type="text/css"/>
</@override>
<@override name="body">

<div class="tabbable tabs-left">
    <div class="row">
        <div class="col-xs-12">
            <div class="orders-navt">
                <ul class="orders-nav">
                    <@daijia>
                        <@shiro.hasPermission name='orderrealtime'>
                            <li class="orders-notclick"><a href="${ctx}/order/realtime">时效</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='order'>
                            <li class="orders-click"><a href="${ctx}/order/daijialist">代驾</a></li>
                        </@shiro.hasPermission>
                    </@daijia>
                    <@zhuan>
                        <@shiro.hasPermission name='zhuan'>
                            <li class="orders-notclick"><a href="${ctx}/zhuanche/orderlist">专车</a></li>
                        </@shiro.hasPermission>
                    </@zhuan>
                    <@pao>
                        <@shiro.hasPermission name='errand'>
                            <li class="orders-notclick"><a href="${ctx}/errand/errandList">跑腿</a></li>
                        </@shiro.hasPermission>
                    </@pao>
                    <@freight>
                        <@shiro.hasPermission name='freight'>
                            <li class="orders-notclick"><a href="${ctx}/freight/freightList">货运</a></li>
                        </@shiro.hasPermission>
                    </@freight>
                    <@zhuanxian>
                        <@shiro.hasPermission name='zhuanxian'>
                            <li class="orders-notclick"  style="width:100px;"><a href="${ctx}/zhuanxian/orderList">快车</a></li>
                        </@shiro.hasPermission>
                    </@zhuanxian>
                    <li class="orders-notclick"><a href="${ctx}/driverrefuserecord/list">拒单</a></li>
                </ul>
            </div>
            <div class="orders-navh">
            	<@shiro.hasPermission name='ordercreate'>
                <button type="button" class="add" onclick="window.open('${ctx}/order/add', '_blank', 'height=770,width=1220,scrollbars=yes,resizable=yes,alwaysRaised=yes,toolbar=no');">
                    <b>+</b>&nbsp;&nbsp;添加订单
                </button>
                </@shiro.hasPermission>
            </div>
        </div>
        <div class="col-xs-1">
        </div>
    </div>
</div>

<div class="tab-content">
    <div class="container-fluid">
        <div class="row query-pad">
            <div class="col-xs-10" style="padding: 0px;">
                <div class="col-xs-4 input-query">
                    <span>订单编号：</span>
                    <input type="text" class="form-control form-contb" id="orderNumber" name="orderNumber"
                           placeholder="请输入订单编号"/>
                </div>
                <div class="col-xs-4 input-query">
                    <span>客户：</span>
                    <input type="text" class="form-control form-contb" id="clientPhone" name="clientPhone"
                           placeholder="请输入客户电话、姓名"/>
                </div>
                <div class="col-xs-4 input-query">
                    <span>服务人员：</span>
                    <input type="text" class="form-control form-contb" id="driverPhone" name="driverPhone"
                           placeholder="请输入服务人员电话、姓名"/>
                </div>
            </div>
            <div class="col-xs-2" style="padding: 0px;">
                <div class="input-query-bttom ">
                    <button id="export_button" style="margin-left:10px;" type="button" class="btn btn-primary"><i
                            class="glyphicon glyphicon-save"></i>导出
                    </button>
                </div>
                <div class="input-query-bttom ">
                    <button id="searchButton" type="button">查询</button>
                </div>
            </div>
        </div>

        <div class="choose" style="display: none;">
            <div class="col-xs-12" style="padding: 0px;">
                <div class="col-xs-11" style="padding: 5px;">
                    <@shiro.isMainCompany>
                        <div class="col-xs-4 input-query" style="text-align: center;">
                            <span>所属公司：</span>
                            <input type="text" class="form-control form-contb" id="companyName" name="companyName"
                                   placeholder="请输入公司名称"/>
                        </div>
                    </@shiro.isMainCompany>
                    <div class="col-xs-8 input-query" style="text-align: center;">
                        <span>下单时间：</span>
                        <input type="text" class="form-control form-conthtl" id="startTime" name="startTime"
                               placeholder="请输入下单起始时间"/>
                        <span style="width:5%">到</span>
                        <input type="text" class="form-control form-conthtl" id="endTime" name="endTime"
                               placeholder="请输入下单结束时间"/>
                    </div>
                </div>
            </div>

            <div class="col-xs-12" style="padding: 0px;">
                <div class="col-xs-11" style="padding: 5px;">
                    <div class="col-xs-8 input-query" style="text-align: center;">
                        <span>完成时间：</span>
                        <input type="text" class="form-control form-conthtl" id="startFinishTime" name="startFinishTime"
                               placeholder="请输入下单起始时间"/>
                        <span style="width:5%">到</span>
                        <input type="text" class="form-control form-conthtl" id="endFinishTime" name="endFinishTime"
                               placeholder="请输入下单结束时间"/>
                    </div>
                </div>
            </div>
             <div class="col-xs-12" style="padding-left:10px; line-height:3;">
                 <div class="col-xs-4 input-query">
                    <span>下 单 人：</span>
                    <input type="text" class="form-control form-contb" id="createOrderName" name="createOrderName"
                           placeholder="请输入下单人名字"/>
            	</div>
            </div>
            <div class="col-xs-12" style="padding:5px; line-height:3;">
                <div class="media-wit melect">
                    <span>订单来源：</span>
                    <input type="checkbox" name="orderType" value="电话预约 ">
                    <span class="checkbox-margin">电话预约 </span>
                    <input type="checkbox" name="orderType" value="司机补单">
                    <span class="checkbox-margin">服务人员补单</span>
                    <input type="checkbox" name="orderType" value="APP预约">
                    <span class="checkbox-margin">APP预约</span>
                    <input type="checkbox" name="orderType" value="微信预约">
                    <span class="checkbox-margin">微信预约</span>
                    <input type="checkbox" name="orderType" value="小程序">
                    <span class="checkbox-margin">小程序</span>
                    <input type="checkbox" name="orderType" value="客户经理">
                    <span class="checkbox-margin">客户经理</span>
                    <input type="checkbox" name="orderType" value="网站预约">
                    <span class="checkbox-margin">网站预约</span>
                </div>
            </div>
            <div class="col-xs-12" style="padding:5px; line-height:3;">
                <div class="media-hit melect">
                    <span>订单状态：</span>
                    <input type="checkbox" name="status" value="new">
                    <span class="checkbox-margin">新单</span>
                    <input type="checkbox" name="status" value="paidan">
                    <span class="checkbox-margin">已派单</span>
                    <input type="checkbox" name="status" value="busy">
                    <span class="checkbox-margin">执行中</span>
                    <input type="checkbox" name="status" value="notpay">
                    <span class="checkbox-margin">未支付</span>
                    <input type="checkbox" name="status" value="finish">
                    <span class="checkbox-margin">已完成</span>
                    <input type="checkbox" name="status" value="cancel">
                    <span class="checkbox-margin">已销单</span>
                </div>
            </div>
            <div class="col-xs-12" style="padding:5px;">
                <div class="media-wit melect">
                    <span>异常订单：</span>
                    <input type="checkbox" name="warm" value="true">
                </div>
            </div>
        </div>
        <div class="query-jiant">
            <a href="#"><img id="jiant" src="${ctx}/assets/img/jiant2.png"/></a>
        </div>
    </div>
</div>

<!--列表-->
<div class="tabta-content">
    <table class="table table-condensed table-striped">
        <tbody>
        <tr>
            <th style='min-width:80px;'>操作</th>
            <th style='min-width:80px;'>状态</th>
            <th style='min-width:80px;'>单号</th>
            <th style='min-width:100px;'>预约时间</th>
            <th style='min-width:300px;'>预约地</th>
            <th style='min-width:80px;'>客户名称</th>
            <th style='min-width:80px;'>客户电话</th>
            <th style='min-width:80px;'>使用人电话</th>
            <th style='min-width:300px;'>目的地</th>
            <th style='min-width:120px;'>实收金额</th>
            <th style='min-width:80px;'>预算金额</th>
            <th style='min-width:300px;'>加收金额</th>
            <@tiaojia>
            <th style='min-width:150px;'>服务人员调价</th>
            </@tiaojia>
            <th style='min-width:120px;'>服务人员</th>
            <th style='min-width:120px;'>服务人员电话</th>
            <@shiro.isMainCompany>
                <th style='min-width:80px;'>所属公司</th>
            </@shiro.isMainCompany>
            <th style='min-width:80px;'>来源</th>
            <th style='min-width:80px;'>下单人</th>
            <th style='min-width:120px;'>结算时间</th>
            <th style='min-width:80px;'>里程</th>
            <th style='min-width:80px;'>等候时间</th>
            <th style='min-width:300px;'>备注</th>
            <th style='min-width:300px;'>销单原因</th>
            <th style='min-width:120px;'>操作</th>
        </tr>
        </tbody>
    </table>
    <br>
    <div style="text-align:center" id="NoData"></div>
    </br>
    <ul class="pagination pull-left pagination-sm pageshow" style="display:none;">
        <li><a></a></li>
    </ul>
    <ul class="pagination pull-left pagination-sm pagedata" style="display:none;">
    </ul>
</div>
<!--列表-->

<form id="cancel_form" class="form-horizontal" action="${ctx}/order/cancelpost" method="post">
    <div class="modal fade" id="dialog_cancel">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">输入销单原因</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="id" id="dialog_cancel_id">

                    <div class="form-group">
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="cancel_reason" value="与客户协商一致取消订单"> 与客户协商一致取消订单
                                </label>
                            </p>
                        </div>
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="cancel_reason" value="客户呼叫多人，只用先到服务人员"> 客户呼叫多人，只用先到服务人员
                                </label>
                            </p>
                        </div>
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="cancel_reason" value="客户拒接电话"> 客户拒接电话
                                </label>
                            </p>
                        </div>
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="cancel_reason" value="客户单方面取消"> 客户单方面取消
                                </label>
                            </p>
                        </div>
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="cancel_reason" value="other"> 其他
                                </label>
                            </p>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-12">
                            <textarea class="form-control" cols="20" id="dialog_cancel_content" name="content" rows="2"
                                      required></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="ok_modal_cancel">提交</button>
                    <button type="button" class="btn btn-default" id="close_modal_cancel">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form>

<form id="powercancel_form" class="form-horizontal" action="${ctx}/order/powercancelpost" method="post">
    <div class="modal fade" id="dialog_powercancel">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">输入销单原因</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="id" id="dialog_powercancel_id">

                    <div class="form-group">
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="powercancel_reason" value="与客户协商一致取消订单"> 与客户协商一致取消订单
                                </label>
                            </p>
                        </div>
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="powercancel_reason" value="客户呼叫多人，只用先到服务人员"> 客户呼叫多人，只用先到服务人员
                                </label>
                            </p>
                        </div>
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="powercancel_reason" value="客户拒接电话"> 客户拒接电话
                                </label>
                            </p>
                        </div>
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="powercancel_reason" value="客户单方面取消"> 客户单方面取消
                                </label>
                            </p>
                        </div>
                        <div class="col-sm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;">
                                    <input type="radio" name="powercancel_reason" value="other"> 其他
                                </label>
                            </p>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-12">
                            <textarea class="form-control" cols="20" id="dialog_powercancel_content" name="content"
                                      rows="2"></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="ok_modal_powercancel">提交</button>
                    <button type="button" class="btn btn-default" id="close_modal_powercancel">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form>

<form id="revoke_form" class="form-horizontal" action="${ctx}/order/revokepost" method="post">
    <div class="modal fade" id="dialog_revoke">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">输入收回原因</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="id" id="dialog_revoke_id">
                    <div class="form-group">
                        <div class="col-sm-12">
                            <textarea class="form-control" cols="20" id="dialog_revoke_content" name="content" rows="2"
                                      required></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="ok_modal_revoke">提交</button>
                    <button type="button" class="btn btn-default" id="close_modal_revoke">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form>

<form id="powerrevoke_form" class="form-horizontal" action="${ctx}/order/powerrevokepost" method="post">
    <div class="modal fade" id="dialog_powerrevoke">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">输入收回原因</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="id" id="dialog_powerrevoke_id">
                    <div class="form-group">
                        <div class="col-sm-12">
                            <textarea class="form-control" cols="20" id="dialog_powerrevoke_content" name="content"
                                      rows="2" required></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary" id="ok_modal_powerrevoke">提交</button>
                    <button type="button" class="btn btn-default" id="close_modal_powerrevoke">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form>

<form id="memo_form" class="form-horizontal" action="${ctx}/order/memopost" method="post">
    <div class="modal fade" id="dialog_memo">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">添加订单备注</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="id" id="dialog_memo_id">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">输入新备注：</label>
                        <div class="col-sm-9">
                            <textarea class="form-control" cols="20" id="dialog_memo_newcontent" name="memo" rows="2"
                                      required></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">已有备注：</label>
                        <div class="col-sm-9">
                            <p class="form-control-static" id="dialog_memo_oldcontent"></p>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="ok_modal_memo">提交</button>
                    <button type="button" class="btn btn-default" id="close_modal_memo">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form>

<!--派单-->
<div id="dialog_paidan" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg">
        <div class="modal-conten">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <div>
                <ul class="modal-paid">
                    <input type="hidden" id="paidanOrderId"/>
                    <input type="hidden" id="paidanOrderLng"/>
                    <input type="hidden" id="paidanOrderLat"/>
                    <li class="modal-dtu hidden-xs">
                        <div id="allmap" style="height:100%;width:100%;">
                        </div>
                    </li>
                    <li class="modal-lbiao">
                        <div class="modal-kehu">
                            <p>客户姓名：<span id="paidanClientName"></span></p>
                            <p>客户电话：<span id="paidanClientPhone"></span></p>
                            <p>预约地址：<span id="paidanFromPlace"></span></p>
                        </div>
                        <div class="modal-sos">
                            <div class="row">
                                <div class="col-xs-5">
                                    <span style=" line-height: 2.3;"><b>推荐服务人员</b></span>
                                </div>
                                <div class="col-xs-7">
                                    <select id="distance" style="width:163px;height:30px;padding:0;margin-right:3px;"
                                            class="form-control">
                                        <option value="5" selected="selected">5公里范围内查找</option>
                                        <option value="10">10公里范围内查找</option>
                                        <option value="15">15公里范围内查找</option>
                                        <option value="20">20公里范围内查找</option>
                                        <option value="50">50公里范围内查找</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="modal-sj" id="paidanDrivers">
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
</@override>

<@override name="footer">
<script type="text/javascript">
    window.daijia = {
        ctx: '${ctx}',
        userId: '<@shiro.principal property='id'/>'
    };
    var hasPermission_dispatch = false;
    var hasPermission_powercancel = false;
    var hasPermission_powerrevoke = false;
    var hasPermission_orderComplete = false;
    var hasPermission_phonevisit = false;
    var hasPermission_ordercreate=false;
    var mainCompany = false;
    var tiaojia = false;
    <@shiro.hasPermission name='dispatch'>
    hasPermission_dispatch = true;
    </@shiro.hasPermission>
    <@shiro.hasPermission name='powercancel'>
    hasPermission_powercancel = true;
    </@shiro.hasPermission>
    <@shiro.hasPermission name='powerrevoke'>
    hasPermission_powerrevoke = true;
    </@shiro.hasPermission>
    <@shiro.hasPermission name='orderComplete'>
    hasPermission_orderComplete = true;
    </@shiro.hasPermission>
    <@shiro.hasPermission name='phonevisit'>
    hasPermission_phonevisit = true;
    </@shiro.hasPermission>
    <@shiro.hasPermission name='ordercreate'>
    hasPermission_ordercreate = true;
    </@shiro.hasPermission>
    <@shiro.isMainCompany>
    mainCompany = true;
    </@shiro.isMainCompany>
    <@tiaojia>
    tiaojia = true;
    </@tiaojia>

</script>
<script src="//api.map.baidu.com/api?v=2.0&ak=AuNk3YS21DSmHEEvIFDf9dbD" type="text/javascript"></script>
<script src="//api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js" type="text/javascript"></script>
<script src="${ctx}/assets/js/RichMarker_min.js" type="text/javascript"></script>
<script src="${ctx}/assets/js/datepicker.js"></script>
<script src="${ctx}/assets/js/jquery.paging.min.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${ctx}/assets/js/pushmessage.js"></script>
<script src="${ctx}/assets/js/order/daijialist.js"></script>
</@override>
<@extends name="../layout.ftl"/>
